package com.xcw.test;

import java.util.Locale;
import java.util.function.Consumer;

/**
 * @Author bhx
 * @Date 2022/8/9 22:53
 * @Description TODO
 */
public class ConsumerAndTenDemo {
    public static void method(String name, Consumer<String> con1,  Consumer<String> con2){
//        con1.accept(name);
//        con2.accept(name);
        // con1===先执行
        // con2===后执行
        con1.andThen(con2).accept(name);
    }

    public static void main(String[] args) {
        method("hello", (name1)->{
            System.out.println(name1.toLowerCase());
        },(name2)->{
            System.out.println(name2.toUpperCase());
        });
    }

}
